﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace Business
{
    class ServiceSubscriberRepository : BaseBusiness
    {
        public static void Update(DataTable dtInput, SqlCommand cmd)
        {
            try
            {
                if (dtInput.Rows.Count > 0)
                {
                    cmd.CommandText = "sp_crm_service_subcriber_UpdateWhenSentMsg";
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Clear();
                    cmd.Parameters.AddWithValue("@List_service_subscirber", dtInput);
                    cmd.Parameters["@List_service_subscirber"].SqlDbType = SqlDbType.Structured;
                    cmd.Parameters["@List_service_subscirber"].TypeName = "dbo.service_subscriber_type";
                    cmd.ExecuteNonQuery();
                }
            }
            catch (Exception e)
            {
                throw e;
            }
        }
    }
}
